/**
 * Created by Allen on 2018/3/6.
 */
import OverViewComp from "containers/supplier-management/overview/supplier-dashboard";
import SupplierDetailComp from "containers/supplier-management/overview/supplier-detail/supplier-detail";
import EnableServiceComp from "containers/supplier-management/overview/enable-service/enable-service";
import YgetQuotaAdjust from "containers/supplier-management/overview/supplier-detail/quota-adjust/yget-quota-adjust";
import ConsumerCardList from "containers/supplier-management/new-consumer-management/consumner-card-list";
import ConsumerOpenPage from "containers/supplier-management/new-consumer-management/consumer-open-page";
import OrderCenter from "containers/supplier-management/order-center/order-center";
import DetailPlane from "containers/supplier-management/order-center/detail/detail-plane";
import AirlinePlatformComp from "containers/supplier-management/airline-platform/airline-platform";
import AirlineConfig from "containers/supplier-management/airline-config/airline-config";
import ZhenXuanMain from "containers/supplier-management/airline-platform/zhenxuan-main";
import BankCompanyManagement from "containers/supplier-management/bank-company-management/bank-company-management";
import AccountSettings from "containers/supplier-management/accounting-settings/accounting-settings";
import AirTicketQuotation from "containers/supplier-management/air-ticket-quotation/air-ticket-quotation";
import AirTicketQuotationDetail from "containers/supplier-management/air-ticket-quotation/air-ticket-quotation-detail";

/** 发票 */
import InvoiceSourceCheckComp from "containers/supplier-management/invoice-source-check";
import InvoiceManagementComp from "containers/supplier-management/invoice-management/invoice-management";
import PriceTaxSeperationRuleComp from "containers/supplier-management/price-tax-seperation-rule";
import InvoiceManagementDetailComp from "containers/request-and-expense-settings/invoice-management/invoice-check-detail/index.js";

// 消费商管理
const supplierManagement = {
  key: "supplier",
  icon: "fork",
  admin: true,
  subMenu: [
    // 发票来源与设置
    {
      key: "invoice-source-inspection",
      url: "/main/supplier/invoice-source-inspection",
      components: InvoiceSourceCheckComp,
      parent: "supplier",
    },
    // 发票管控
    {
      key: "invoice-management-control",
      url: "/main/supplier/invoice-management-control",
      components: InvoiceManagementComp,
      parent: "supplier",
      children: {
        invoiceCheckDetail: {
          key: "invoice-management-control-detail",
          url: "/main/supplier/invoice-management-control/detail/:id",
          components: InvoiceManagementDetailComp,
          parent: "invoice-management-control",
        },
        // invoiceControlDetail: {
        //   key: "invoice-controls-detail",
        //   url: "/main/supplier/invoice-management-control/invoice-controls/:id",
        //   components: InvoiceControlsDetail,
        //   parent: "invoice-management-control",
        // },
        // configurationCenter: {
        //   key: "configuration-center",
        //   url:
        //     "/main/supplier/invoice-management-control/:tab/configuration-center",
        //   components: ConfigurationCenterComp,
        //   parent: "setting",
        //   fpItem: ["settings.control.disabled"],
        //   fpValue: [[false, undefined]],
        //   tenant: true,
        //   children: {
        //     configurationDetail: {
        //       key: "configuration-detail",
        //       url: "/main/supplier/configuration-center/detail/:id",
        //       components: ConfigurationDetailComp,
        //       parent: "configuration-center",
        //     },
        //   },
        // },
      },
      // ng-hide="functionProfile['WEB.INVM.Disable']" 请保留，之后参考
    },
    // 价税分离
    {
      key: "price-tax-separation",
      url: "/main/supplier/price-tax-separation",
      components: PriceTaxSeperationRuleComp,
      parent: "supplier",
    },
    // 消费商服务开通
    {
      key: "overview",
      url: "/main/supplier/overview",
      components: OverViewComp,
      parent: "supplier",
      company: true,
      hideInUrl: ["console-my.huilianyi.com", "console-sg.huilianyi.com"],
      children: {
        // 供应商详情服务控制台
        supplierDetail: {
          key: "supplier-detail",
          url: "/main/supplier/overview/:supplierName",
          components: SupplierDetailComp,
          parent: "overview",
        },
        // 启用服务
        enableService: {
          key: "enable-service",
          url:
            "/main/supplier/overview/enable-service/:supplierName/:supplierChinaName",
          components: EnableServiceComp,
          parent: "overview",
        },
        // 源慧额度调整
        setYget: {
          key: "set-yget",
          url: "/main/supplier/overview/set-yget/setYget",
          components: YgetQuotaAdjust,
          parent: "overview",
        },
      },
    },
    // 消费商服务开通2
    {
      key: "consumer-card-list",
      url: "/main/supplier/consumer-card-list",
      components: ConsumerCardList,
      parent: "supplier",
      company: false,
      tenant: true,
      hideInUrl: "console-my.huilianyi.com",
      children: {
        consumerDetail: {
          key: "consumer-open-page",
          url: "/main/supplier/consumer-card-list/consumer-open-page/:type",
          components: ConsumerOpenPage,
          parent: "consumer-card-list",
        },
      },
    },
    // 订单中心
    {
      key: "consumer-order-center",
      url: "/main/supplier/consumer-order-center",
      components: OrderCenter,
      parent: "supplier",
      children: {
        planeDetail: {
          key: "consumer-plane-detail",
          url:
            "/main/supplier/consumer-order-center/consumer-plane-detail/:recordId",
          components: DetailPlane,
          parent: "consumer-order-center",
        },
      },
    },
    // 对账设置
    {
      key: "supplier-account-settings",
      url: "/main/supplier/supplier-account-settings",
      components: AccountSettings,
      parent: "supplier",
      company: false,
      tenant: true,
    },
    // 汇联易甄选服务
    {
      key: "airline-platform",
      url: "/main/supplier/airline-platform",
      components: AirlinePlatformComp,
      parent: "supplier",
      children: {
        airlineConfig: {
          key: "airline-config",
          url:
            "/main/supplier/airline-platform/config/:companyOID/:companyName",
          // components: AirlineConfig,
          components: ZhenXuanMain,
          parent: "airline-platform",
        },
      },
    },
    // 银企直联服务
    {
      key: "bank-company-management",
      url: "/main/supplier/bank-company-management",
      components: BankCompanyManagement,
      parent: "supplier",
    },
    // 机票报价
    {
      key: "air-ticket-quotation",
      url: "/main/supplier/air-ticket-quotation",
      components: AirTicketQuotation,
      parent: "supplier",
      children: {
        rfpdetail: {
          key: "ticket-quotation-detail",
          url:
            "/main/supplier/air-ticket-quotation/ticket-quotation-detail/:id",
          components: AirTicketQuotationDetail,
          parent: "airline-platform",
        },
      },
    },
  ],
};

export default supplierManagement;
